<template>
  <div style="display: inline-block;">
    <el-button v-if="!isAdd" size="small" icon="el-icon-edit" @click="show=!show"></el-button>
    <el-button v-if="isAdd" size="small" @click="show=!show">新增</el-button>
    <div id="dialog-container">
      <el-dialog v-dialogDrag :title="dialogTitle" append-to-body :visible.sync="show" @close="show=false" :show="show" :close-on-click-modal="false"
        width="680px">
        <el-form :model="form" :inline="true" size="small" label-width="100px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="工号：">
                <el-input v-model="form.name"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="用户姓名：">
                <el-input v-model="form.name"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="密码：">
                <el-input v-model="form.name"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="厂：">
                <el-input v-model="form.name"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="确认密码：">
                <el-input v-model="form.name"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="职务：">
                <el-input v-model="form.name"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="部门：">
                <el-input v-model="form.name"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="科室：">
                <el-input v-model="form.name"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="邮件地址：">
                <el-input v-model="form.name"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="备注：">
                <el-input v-model="form.name" type="textarea" :row="2" style="width: 520px;"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="show = false">确 定</el-button>
          <el-button @click="show = false">取 消</el-button>
        </div>
      </el-dialog>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'EditUser',
    data() {
      return {
        show: false,
        form: {
          name: ''
        }
      }
    },
    props: {
      dialogTitle: {
        required: true,
      },
      isAdd: {
        type: Boolean,
        required: true,
        default: true,
      }
    },
  }

</script>
